Skip to content

Migrate to Hugo #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 10, 2025
Merged

Migrate to Hugo #56

merged 16 commits into from
Mar 10, 2025

Conversation

dscho
Copy link
Member

@dscho dscho commented Mar 10, 2025

In preparation for moving Git for Windows' wiki pages to https://gitforwindows.org/, let's modernize the deployment: Instead of doing some home-grown static site generation, committing the HTML files and then deploying all files, let's use Hugo instead.

This has served https://git-scm.com/ well, and I also already converted https://gitgitgadget.github.io/ (as an exercise in preparation for this here PR).

Here are the visual changes:

original new
original index new index
original 32-bit new 32-bit
original governance-model new governance-model
original requirements new requirements

dscho added 15 commits March 9, 2025 13:14
Right now, Git for Windows' home page is built using `grunt`, and the
result is then committed and uploaded to GitHub Pages.

However, a much more natural development experience can be achieved by
using Hugo (https://gohugo.io/) instead.

In preparation for migrating to Hugo, let's drop all `grunt`-based
stuff.

Note that the `create-screenshot-thumbnails.js` script would still need
the `jimp` dependency defined in `package.json`, but that script is not
run on a regular basis.

Signed-off-by: Johannes Schindelin <[email protected]>
The default layout is a slightly edited resurrection of the just-deleted
`markdown-template.html`.

Signed-off-by: Johannes Schindelin <[email protected]>
Hugo has a bit of an opinionated directory layout, at least on its paved
path.

Signed-off-by: Johannes Schindelin <[email protected]>
The 32-bit, governance-model and requirements pages are now generated
via Hugo.

Signed-off-by: Johannes Schindelin <[email protected]>
When a web font's URL is specified via `href="//<host>"`, the protocol
is inherited from the loaded page. That's all good and fine if `https`
(or even `http`) is used to load the page, but falls apart when the
protocol is `file`, as it is the case when testing locally.

Therefore, let's just use `https` instead. This should be used nowadays
instead of `http`, anyways.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
They are handled by a custom output format, for details, see
https://gohugo.io/configuration/output-formats/#create-an-output-format.

Signed-off-by: Johannes Schindelin <[email protected]>
The `bump-version.js` script is used by Git for Windows' automation to
update the web page whenever a new version is published.

Now that the web pages are generated via Hugo, we need to update this
script, too.

Signed-off-by: Johannes Schindelin <[email protected]>
Now those are generated automatically, too.

Signed-off-by: Johannes Schindelin <[email protected]>
This allows for better reuse of the footer. (And yes, it is not quite
correct a name, given that the current pages also show it at a header;
This will all make more sense once the home page is converted to Hugo,
where a different header is shown.)

Signed-off-by: Johannes Schindelin <[email protected]>
Inline CSS is hard to manage, so let's move it elsewhere.

To prepare for migrating also the home page to Hugo, let's make that
inline CSS contingent on <body> having the `page` class.

Signed-off-by: Johannes Schindelin <[email protected]>
There are still plenty of HTML constructs in there; This is okay, as
Markdown explicitly allows for that _and_ because some of those
constructs are not easily expressed in Markdown (such as links with the
`target="_blank"` attribute).

Signed-off-by: Johannes Schindelin <[email protected]>
This commit adds a GitHub workflow that runs in all Pull Requests, to
verify that the site builds.

Signed-off-by: Johannes Schindelin <[email protected]>
This finishes the transition to a Hugo-backed site.

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho self-assigned this Mar 10, 2025
@dscho
Copy link
Member Author

dscho commented Mar 10, 2025

The site can also be seen live here: https://dscho.github.io/git-for-windows.github.io/

@dscho dscho requested review from rimrul and mjcheetham March 10, 2025 11:45
This has been there for ages, but is unlikely to be needed: Internet
Explorer was retired a long time ago.

Besides, Hugo silently removes this, so...

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho merged commit 52bda43 into git-for-windows:main Mar 10, 2025
1 check passed
@dscho dscho deleted the hugo branch March 10, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants